import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '../components/login.vue'
import Home from '../components/home.vue'
import oauthclientdetails from "../yunxi/oauthclientdetails";
import pmscategory from "../yunxi/pmscategory";
import torder from "../yunxi/torder";
import tproduct from "../yunxi/tproduct";
import user from "../yunxi/user";
import refund from "../yunxi/refund";
import shop from "../yunxi/shop";
import  detail from "../yunxi/detail"
import de from "element-ui/src/locale/lang/de";
Vue.use(VueRouter)

  const routes = [
    {
      path: '/',
      redirect: '/login'
    },
    {
      path: '/detail',
      component: detail
    },
    {
      path: '/login',
      component: Login
    },
    {
      path: '/shop',
      component: shop
    },
    {
      path: '/home',
      component: Home,
      children:[
        {
          path: 'tproduct',
          component: tproduct,
        },
        {
          path: 'torder',
          component: torder,
        },
        {
          path: 'pmscategory',
          component: pmscategory,
        },
        {
          path: 'oauthclientdetails',
          component: oauthclientdetails,
        },
        {
          path: 'refund',
          component: refund,
        },
      ]
    },
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
